﻿using System; 
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.ServiceModel;
using System.Text;
namespace TopWinCMS.ServiceInterface
{
    public class UploadServiceProxy : ClientBase<IUploadService>, IUploadService
    {
        #region 构造函数
        public UploadServiceProxy(int UserNo, string Token)
            : base("uploadServiceProxy")
        {
            this.ChannelFactory.Credentials.UserName.UserName = UserNo.ToString();
            this.ChannelFactory.Credentials.UserName.Password = Token;
            this.Open();
        }
        #endregion

        /// <summary>
        /// 新建或更新个人档案
        /// </summary>
        /// <param name="personArchive">个人档案</param>
        /// <returns>非空返回档案ID，空串为新建或更新失败</returns>
        public void StoreFileAdvanced(string fileName, byte[] data, int dataLength, string parameters, bool firstChunk, bool lastChunk)
        {
            this.Channel.StoreFileAdvanced(fileName, data, dataLength, parameters, firstChunk, lastChunk);
        }
        public void CancelUpload(string filename)
        {
            this.Channel.CancelUpload(filename);

        }
    }
}